Memory Overview
BindAI provides a memory package for storing, retrieving, searching, and managing memory records through a common provider interface. The package includes aMemory facade, a MemoryProvider interface, a MemoryRegistry, and a MemoryManager. These components provide the core memory API. How memory is connected to an Agent, configured in Studio, or persisted across application executions depends on the relevant integration and provider implementation.
What Is Memory?
Memory provides an API for working with records that an application can store and retrieve. The core package separates memory operations from the underlying storage provider:Memory facade delegates storage operations to its selected provider and exposes a common interface to application code.
Core Components
Memory
Memory is the high-level interface for memory operations.
It supports:
set(record)— store a memory record.get(key, namespace="default")— retrieve a record.search(query, namespace="default", limit=10, metadata=None)— search records.delete(key, namespace="default")— delete a record.exists(key, namespace="default")— check whether a record exists.clear(namespace="default")— clear a namespace.close()— close the provider when it exposes a callableclosemethod.
None. When no provider is supplied, it selects the registered provider named memory.
Example:
memory provider. It does not select SQLite automatically.
MemoryProvider
MemoryProvider is the abstract base class for memory providers.
Implementations must provide the following operations:
setgetsearchdeleteexistsclear
MemoryRegistry.register.
MemoryRegistry
MemoryRegistry manages provider classes by name.
Its API includes:
register(name, provider)— register a provider class.provider(name)— retrieve a registered provider class.providers()— return a copy of the provider registry.unregister(name)— remove a provider registration.clear()— remove all provider registrations.
MemoryProvider.
The registry is a package-level mechanism; its existence alone does not establish that Studio exposes provider registration or configuration.
MemoryManager
MemoryManager provides record-level lifecycle utilities.
The implemented methods include:
should_promote(record)andpromote(record)— determine whether a record should be promoted and, when applicable, change its type to semantic memory.should_forget(record)andforget(record)— check whether a record’s expiration time has passed.touch(record)— update access tracking.reinforce(record, amount=0.25)— increase record importance.decay(record, amount=0.05)andweaken(record, amount=0.1)— reduce record importance without allowing it to become negative.set_expiration(record, days=...)andclear_expiration(record)— set or remove expiration metadata.
Registered Built-in Providers
The current registry source registers the following provider names:
These names are registered by
bindai_memory.registry. Registration does not, by itself, guarantee that a provider’s external dependencies are installed, that its backend is reachable, or that it is exposed through Studio.
Consult the relevant provider implementation and its configuration requirements before using a specific backend.
Custom Providers
The package supports registering custom providers that inherit fromMemoryProvider.
A custom provider must implement the abstract methods required by the interface. After registration, its name can be passed to Memory, provided the registration is available in the running application.
This describes the package-level extension mechanism. It does not establish a Studio configuration workflow for custom providers.
Record Retrieval and Lifecycle Updates
TheMemory.get implementation performs additional operations when a record is found successfully:
- It updates the record’s access information through
MemoryManager.touch. - It reinforces the record’s importance.
- It writes the updated record through the provider.
- It retrieves the record again and returns that result.
Memory facade’s retrieval behavior in the inspected implementation.
Other lifecycle operations, such as promotion and expiration checks, are separate manager methods and should not be described as automatic background processes without further implementation evidence.
Memory and Agent Execution
The memory package defines the storage and record-management API. It should not be confused with the code that integrates memory into Agent execution. Before documenting automatic conversation loading, automatic saving after an Agent run, persistence across workflow runs, or Studio memory configuration, verify those behaviors in the relevant Agent, runtime, and Studio source code.Memory and Workflow State
Memory and workflow state have different responsibilities:- Memory provides operations on memory records through a provider.
- Workflow state represents the state of a workflow execution.
Memory and Knowledge
Memory and Knowledge are separate parts of the framework.- Memory exposes operations for storing and retrieving memory records.
- Knowledge provides the framework’s knowledge and retrieval functionality.
Storage and Security
Choose a provider according to the application’s actual storage requirements and deployment environment. Memory records may contain sensitive application data. Consider access controls, credentials, backup protection, retention requirements, and deletion procedures for the selected backend. Avoid depending on undocumented internal database schemas as public APIs.Summary
The BindAI memory package provides:- A common
MemoryProviderinterface. - A
Memoryfacade for record operations. - A
MemoryRegistryfor built-in and custom provider classes. - A
MemoryManagerfor record-level lifecycle utilities. - Registered provider implementations for in-memory, SQLite, vector, PostgreSQL, Pinecone, and Chroma storage.
